package com.elh.nio.network;

import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;

/**
 * @author liulei
 **/
public class Test1 {

    public static void main(String[] args) {
        try {
            Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
            while(networkInterfaces.hasMoreElements()){
                NetworkInterface networkInterface = networkInterfaces.nextElement();
                System.out.println("网络设备名称" + networkInterface.getName());
                System.out.println("网络设备显" + networkInterface.getName());
            }
        } catch (SocketException e) {
            throw new RuntimeException(e);
        }

    }

}
